import pandas as pd

df1 = pd.read_csv(r"/Users/tanxiong/Documents/test.csv",sep=" ",nrows=100,encoding="utf-8-sig")
print(df1)
print(df1.columns)
print("展示head默认数据:\n{}".format(df1.head()))
print("展示前两行数据:\n{}".format(df1.head(2)))
print("shape 获取数据表的大小\n{}".format(df1.shape))
print("info 获取数据类型\n{}".format(df1.info))
print("describe() 数据 \n{}".format(df1.describe()))

df2= pd.DataFrame([[20,5000,2],[25,8000,3],[30,9000,3],[28,7000,2]],columns=["年龄","收入","家属数"])
print(df2)
print("df2 describe() 值\n{}".format(df2.describe()))


